<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%
		//String basepath = request.getContextPath() + "/Global/FCKeditor/";
		request.setAttribute("editor_basepath", request.getContextPath()+"/Global/FCKeditor");
		String id = request.getParameter("id");
		if(id==null || id==""){
			id = "alphaEditor";
		}
		request.setAttribute("editor_id", id);
%>
		
<html>
	<head>
		<title>FCKeditor</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<script type="text/javascript">
	function FCKeditor_OnComplete( editorInstance )
	{
		var fnInit = parent.window["<%=id%>_fnInit"];
		if(fnInit)
			fnInit();
		
		document.getElementById("<%=id%>_form").onsubmit = function(){
				var fnSave = parent.window["<%=id%>_fnSave"];
				if(fnSave && typeof fnSave == 'function'){
					fnSave(FCKeditorAPI.GetInstance("<%=id%>").GetXHTML(true));
				}
				return false;
			}
	}
		</script>
		<style>
			body {margin:0;padding:0;}
		</style>
	</head>
	<body>
		<form id="<%=id %>_form">
			<FCK:editor id="${editor_id}" basePath="${editor_basepath}/" width="100%" height="100%"
				imageBrowserURL="${editor_basepath}/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"
				linkBrowserURL="${editor_basepath}/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"
				flashBrowserURL="${editor_basepath}/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"
				imageUploadURL="${editor_basepath}/editor/filemanager/upload/simpleuploader?Type=Image"
				linkUploadURL="${editor_basepath}/editor/filemanager/upload/simpleuploader?Type=File"
				flashUploadURL="${editor_basepath}/editor/filemanager/upload/simpleuploader?Type=Flash">
				
			</FCK:editor>
		</form>
	</body>
</html>